package com.hframe.xml;

import com.hframe.data.DRef;
import com.hframe.type.TFilter;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by heqian on 17-9-22.
 */
public class XmlFiletr extends TFilter {
    protected Map<String, String> attribute = new HashMap<>();
    protected String[] keys = null;
    protected boolean isData = false;
    protected String namespace;
    protected String valuespace;
    protected String comment;

    public String getNamespace() {
        return namespace;
    }

    public String getValuespace() {
        return valuespace;
    }

    public void setNamespace(String name, String value) {
        this.namespace = name;
        this.valuespace = value;
    }

    protected String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String[] getKeys() {
        return keys;
    }

    public void setKeys(String... keys) {
        this.keys = keys;
    }

    protected boolean isData() {
        return isData;
    }

    public void setData(boolean data) {
        isData = data;
    }

    /**
     * 获得XML属性
     *
     * @param name 属性名
     * @return 属性值
     */
    public String getAttribute(String name) {
        return attribute.get(name);
    }

    /**
     * 设置属性
     *
     * @param name  属性名
     * @param value 属性值
     */
    public void addAttribute(String name, String value) {
        attribute.put(name, value);
    }

    public void setAttribute(DRef<? extends DRef> data) {

    }

    public Map<String, String> getAttributes() {
        return attribute;
    }
}